import pandas as pd
aaa=sqlContext.sql("""
select distinct msisdn FROM bitcoin.recent
limit 5000
""")
writer = pd.ExcelWriter("/home/result/hongmu/20181018.xlsx",engine='xlsxwriter')
aaa.toPandas().to_excel(writer, sheet_name='Sheet1')
writer.save()
